Skip to content

Commit

Permalink
Merge pull request #799 from blueyed/minor
Browse files Browse the repository at this point in the history
Minor improvements
  • Loading branch information
blueyed committed Jan 14, 2020
2 parents febbff4 + 8d9ab85 commit b514bf2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pytest_django/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@


@pytest.fixture(scope="session")
def django_db_modify_db_settings_tox_suffix(request):
def django_db_modify_db_settings_tox_suffix():
skip_if_no_django()

tox_environment = os.getenv("TOX_PARALLEL_ENV")
Expand Down
10 changes: 5 additions & 5 deletions pytest_django/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ def _get_option_with_source(option, envname):
_setup_django()


def pytest_report_header(config):
def pytest_report_header():
if _report_header:
return ["django: " + ", ".join(_report_header)]

Expand Down Expand Up @@ -415,7 +415,7 @@ def pytest_runtest_setup(item):
_disable_class_methods(item.cls)


def pytest_collection_modifyitems(session, config, items):
def pytest_collection_modifyitems(items):
def get_order_number(test):
marker_db = test.get_closest_marker('django_db')
if marker_db:
Expand Down Expand Up @@ -553,7 +553,7 @@ def _dj_autoclear_mailbox():


@pytest.fixture(scope="function")
def mailoutbox(monkeypatch, django_mail_patch_dns, _dj_autoclear_mailbox):
def mailoutbox(django_mail_patch_dns, _dj_autoclear_mailbox):
if not django_settings_is_configured():
return

Expand All @@ -570,7 +570,7 @@ def django_mail_patch_dns(monkeypatch, django_mail_dnsname):


@pytest.fixture(scope="function")
def django_mail_dnsname(monkeypatch):
def django_mail_dnsname():
return "fake-tests.example.com"


Expand Down Expand Up @@ -605,7 +605,7 @@ def restore():


@pytest.fixture(autouse=True, scope="session")
def _fail_for_invalid_template_variable(request):
def _fail_for_invalid_template_variable():
"""Fixture that fails for invalid variables in templates.
This fixture will fail each test that uses django template rendering
Expand Down
5 changes: 2 additions & 3 deletions tests/test_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,13 +417,12 @@ def test_serve_static_with_staticfiles_app(self, django_testdir, settings):
"""
django_testdir.create_test_module(
"""
import pytest
from django.utils.encoding import force_str
try:
from urllib2 import urlopen, HTTPError
from urllib2 import urlopen
except ImportError:
from urllib.request import urlopen, HTTPError
from urllib.request import urlopen
class TestLiveServer:
def test_a(self, live_server, settings):
Expand Down

0 comments on commit b514bf2

Please sign in to comment.