Skip to content

pytest_addoption: use group.addoption #833

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 30, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions pytest_django/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,47 +63,47 @@

def pytest_addoption(parser):
group = parser.getgroup("django")
group._addoption(
group.addoption(
"--reuse-db",
action="store_true",
dest="reuse_db",
default=False,
help="Re-use the testing database if it already exists, "
"and do not remove it when the test finishes.",
)
group._addoption(
group.addoption(
"--create-db",
action="store_true",
dest="create_db",
default=False,
help="Re-create the database, even if it exists. This "
"option can be used to override --reuse-db.",
)
group._addoption(
group.addoption(
"--ds",
action="store",
type=str,
dest="ds",
default=None,
help="Set DJANGO_SETTINGS_MODULE.",
)
group._addoption(
group.addoption(
"--dc",
action="store",
type=str,
dest="dc",
default=None,
help="Set DJANGO_CONFIGURATION.",
)
group._addoption(
group.addoption(
"--nomigrations",
"--no-migrations",
action="store_true",
dest="nomigrations",
default=False,
help="Disable Django migrations on test setup",
)
group._addoption(
group.addoption(
"--migrations",
action="store_false",
dest="nomigrations",
Expand All @@ -113,7 +113,7 @@ def pytest_addoption(parser):
parser.addini(
CONFIGURATION_ENV, "django-configurations class to use by pytest-django."
)
group._addoption(
group.addoption(
"--liveserver",
default=None,
help="Address and port for the live_server fixture.",
Expand All @@ -128,7 +128,7 @@ def pytest_addoption(parser):
type="bool",
default=True,
)
group._addoption(
group.addoption(
"--fail-on-template-vars",
action="store_true",
dest="itv",
Expand Down