Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Discuss Data Project
Discuss Data
Commits
5ee16013
Commit
5ee16013
authored
Jun 02, 2020
by
hynek
🤤
Browse files
test: reconfigure pytest and coverage
skip empty, init, admins, apps
parent
0c2418e5
Changes
8
Hide whitespace changes
Inline
Side-by-side
.coveragerc
View file @
5ee16013
[run]
include = discuss_data/*
omit =
*
migrations*, *
tests
*
omit =
venv/*, */tests/*, */
migrations
/
*, *
/urls.py, */settings/
*
plugins =
django_coverage_plugin
[report]
skip_empty = True
omit = */__init__.py, */admin.py, */apps.py
[html]
directory = htmlcov
discuss_data/__init__.py
deleted
100644 → 0
View file @
0c2418e5
__version__
=
"0.5.0"
__version_info__
=
tuple
(
[
int
(
num
)
if
num
.
isdigit
()
else
num
for
num
in
__version__
.
replace
(
"-"
,
"."
,
1
).
split
(
"."
)
]
)
discuss_data/conftest.py
View file @
5ee16013
import
pytest
# enable database for all tests
@
pytest
.
fixture
(
autouse
=
True
)
def
enable_db_access_for_all_tests
(
db
):
pass
# pytest finds added options only in root conftest.py if not configured otherwise
def
pytest_addoption
(
parser
):
...
...
@@ -14,3 +19,13 @@ def pytest_addoption(parser):
# list marker if requested with 'pytest --markers'
def
pytest_configure
(
config
):
config
.
addinivalue_line
(
"markers"
,
"integration: mark a test as integration test"
)
def
pytest_collection_modifyitems
(
config
,
items
):
if
config
.
getoption
(
"--integration"
):
# --integration given in cli: do not skip integration tests
return
skip_integration
=
pytest
.
mark
.
skip
(
reason
=
"need --integration option to run"
)
for
item
in
items
:
if
"integration"
in
item
.
keywords
:
item
.
add_marker
(
skip_integration
)
discuss_data/ddcomments/tests.py
deleted
100644 → 0
View file @
0c2418e5
from
django.test
import
TestCase
# Create your tests here.
discuss_data/ddpublications/tests.py
deleted
100644 → 0
View file @
0c2418e5
from
django.test
import
TestCase
# Create your tests here.
discuss_data/dhrep/__init__.py
deleted
100644 → 0
View file @
0c2418e5
discuss_data/pages/tests.py
deleted
100644 → 0
View file @
0c2418e5
from
django.test
import
TestCase
# Create your tests here.
pytest.ini
View file @
5ee16013
[pytest]
addopts
=
--ds=config.settings.test
DJANGO_SETTINGS_MODULE
=
config.settings.test
python_files
=
tests.py test_*.py
norecursedirs
=
node_modules
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment