databio / yacman

YAML configuration manager
https://pypi.org/project/yacman
BSD 2-Clause "Simplified" License
7 stars 2 forks source link

how to run tests? #49

Closed nsheff closed 3 years ago

nsheff commented 3 years ago

when I run pytest I always get this error and I can't figure it out:

pytest
============================================== test session starts ===============================================
platform linux -- Python 3.8.5, pytest-4.6.9, py-1.8.1, pluggy-0.13.0
rootdir: /home/nsheff/code/yacman
collected 94 items / 1 errors / 93 selected                                                                      

===================================================== ERRORS =====================================================
_________________________________ ERROR collecting locking_tests/test_locking.py _________________________________
locking_tests/test_locking.py:14: in <module>
    args = parser.parse_args()
/usr/lib/python3.8/argparse.py:1780: in parse_args
    args, argv = self.parse_known_args(args, namespace)
/usr/lib/python3.8/argparse.py:1812: in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
/usr/lib/python3.8/argparse.py:2046: in _parse_known_args
    self.error(_('the following arguments are required: %s') %
/usr/lib/python3.8/argparse.py:2533: in error
    self.exit(2, _('%(prog)s: error: %(message)s\n') % args)
/usr/lib/python3.8/argparse.py:2520: in exit
    _sys.exit(status)
E   SystemExit: 2
------------------------------------------------ Captured stderr -------------------------------------------------
usage: pytest [-h] -p PATH -i ID -w WAIT
pytest: error: the following arguments are required: -p/--path, -i/--id, -w/--wait
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================ 1 error in 0.14 seconds =============================================
nsheff commented 3 years ago

you have to run pytest tests -- it didn't use to be this way, that you have to specify the folder... when did this change?

stolarczyk commented 3 years ago

I guess it changed when I added the locking_tests in this repo. I've always specified the folder when running tests so I didn't notice. We can change the name of the folder so it doesn't get caught by the pytest command if you view this as an issue.