Skip to content

'LiveServer' object has no attribute 'url' #140

Description

@Roguelazer

Describe the bug
When using live_server mode, the actual live_server fixture cannot be repr'd because of the missing url attribute.

This appears to have been broken in e9b8321, which removed the url() method

To Reproduce
Add pytest-flask to a project and attempt to print the live_server fixture, as so:

import pytest
import flask


@pytest.fixture(scope='session')
def app():
    return flask.Flask('test')

def test_foo(client, live_server):
    print(live_server)

Expected behavior
Pretty print

Actual Behavior

self = <[AttributeError("'LiveServer' object has no attribute 'url'") raised in repr()] LiveServer object at 0x7f0c7b63c6a0>

    def __repr__(self):
>       return "<LiveServer listening at %s>" % self.url()
E       AttributeError: 'LiveServer' object has no attribute 'url'

Environment (please complete the following information):

  • OS: Linux
  • Python Version: all
  • pytest-flask version: 1.2.0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions