from sio3pack.graph import GraphOperation
# Package unpacking
import sio3pack, sio3workers
from django.conf import settings
package = sio3pack.from_file(path_to_package, django_settings=settings)
graph_op: GraphOperation = package.get_unpack_graph()
results = sioworkers.run(graph_op)
graph_op.return_results(results)
package.save_to_db(problem_id=1)
import sio3pack, sio3workers.local
package = sio3pack.from_file(path_to_package)
graph_op: GraphOperation = package.get_unpack_graph()
results = sio3workers.local.run(graph_op)
graph_op.return_results(results)
Install the package in editable mode and make sure that django
and
pytest-django
are not installed.
pip install -e ".[tests]"
pip uninstall django pytest-django
Then follow the instructions in General testing information.
Install the package in editable mode along with Django dependencies:
pip install -e ".[django,tests,django_tests]"
Then follow the instructions in General testing information.
Run the tests with pytest
in the root directory of
the repository.
pytest -v
To run tests in parallel, use the following command.
pytest -v -n auto
To run coverage tests, use the following command.
pytest -v --cov=sio3pack --cov-report=html
The coverage report will be generated in the file htmlcov/index.html
.