algebra8 / knots Goto Github PK
View Code? Open in Web Editor NEWPython Braid Generator Package
Home Page: https://algebra8.github.io/braidgenerator_doc.github.io/
License: MIT License
Python Braid Generator Package
Home Page: https://algebra8.github.io/braidgenerator_doc.github.io/
License: MIT License
Executing tests from the top level of the repository fails. It is common practice for developers to execute unit tests on the repository while making changes, and Unit Tests in particular should be executable without installing the module.
This change will streamline development work, and simplify automated testing (for CI/CD), and improve code portability (simplify refactoring).
Suggested change:
Move existing test files from the top level of the repo into tests folders at the same level as the .py files they test.
Use relative imports in the test files.
|── braidgenerator
| |---- tests
| | |---- brainword_test.py
| | |---- markovchain_test.py
│ ├── init.py
│ ├── braidword.py
│ └── markovchain.py
│ ├── decorators
| | |---- tests
| | | |---- brainword_test.py
| | | |---- markovchain_test.py
│ │ ├── init.py
│ │ ├── braidword.py
│ │ └── markovchain.py
Example Error:
> pytest
======================================= test session starts ========================================
platform linux -- Python 3.9.5, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: ~/projects/Knots
collected 0 items / 2 errors
============================================== ERRORS ==============================================
_____________________________ ERROR collecting tests/test_braidword.py _____________________________
ImportError while importing test module '~/projects/Knots/tests/test_braidword.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../miniconda3/envs/knots/lib/python3.9/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_braidword.py:2: in <module>
from braidgenerator import BraidWord
E ModuleNotFoundError: No module named 'braidgenerator'
____________________________ ERROR collecting tests/test_markovchain.py ____________________________
ImportError while importing test module '~/projects/Knots/tests/test_markovchain.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../miniconda3/envs/knots/lib/python3.9/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_markovchain.py:2: in <module>
from braidgenerator import MarkovChain
E ModuleNotFoundError: No module named 'braidgenerator'
===================================== short test summary info ======================================
ERROR tests/test_braidword.py
ERROR tests/test_markovchain.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
======================================== 2 errors in 0.08s =========================================
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.