Functional read-only app
This commit is contained in:
0
netoolclient/tests/__init__.py
Normal file
0
netoolclient/tests/__init__.py
Normal file
35
netoolclient/tests/netoolclient.py
Normal file
35
netoolclient/tests/netoolclient.py
Normal file
@ -0,0 +1,35 @@
|
||||
import os
|
||||
import sys
|
||||
import tempfile
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
def run_tests():
|
||||
project_path = Path(__file__).parent.parent
|
||||
os.chdir(project_path)
|
||||
|
||||
# Determine any args to pass to pytest. If there aren't any,
|
||||
# default to running the whole test suite.
|
||||
args = sys.argv[1:]
|
||||
if len(args) == 0:
|
||||
args = ["tests"]
|
||||
|
||||
returncode = pytest.main(
|
||||
[
|
||||
# Turn up verbosity
|
||||
"-vv",
|
||||
# Disable color
|
||||
"--color=no",
|
||||
# Overwrite the cache directory to somewhere writable
|
||||
"-o",
|
||||
f"cache_dir={tempfile.gettempdir()}/.pytest_cache",
|
||||
] + args
|
||||
)
|
||||
|
||||
print(f">>>>>>>>>> EXIT {returncode} <<<<<<<<<<")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
run_tests()
|
3
netoolclient/tests/test_app.py
Normal file
3
netoolclient/tests/test_app.py
Normal file
@ -0,0 +1,3 @@
|
||||
def test_first():
|
||||
"""An initial test for the app."""
|
||||
assert 1 + 1 == 2
|
Reference in New Issue
Block a user