diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 0c92afca1..c339b72cd 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -188,8 +188,6 @@ Note that you can pass multiple test names in the above examples:: $ py.test test_aliases.py test_environ.py -Happy testing! - ---------------------------------- Writing the Tests - Advanced ---------------------------------- @@ -216,7 +214,7 @@ when writting tests it's best to use pytest features i.e parametrization:: ... this will run the test two times each time with the respective `test_env`. -This can be done with for loop too but the test will run +This can be done with a for loop too but the test will run only once for the different test cases and you get less isolation. With that in mind, each test should have the least `assert` statements, @@ -224,6 +222,8 @@ preferably one. At the moment, xonsh doesn't support any pytest plugins. +Happy Testing! + How to Document ==================== diff --git a/tests/test_imphooks.py b/tests/test_imphooks.py index 443f34f8c..ce7d40748 100644 --- a/tests/test_imphooks.py +++ b/tests/test_imphooks.py @@ -12,7 +12,7 @@ import builtins @pytest.yield_fixture(autouse=True) def imp_env(xonsh_execer): - """Call `load_builtins with `xonsh_execer`""" + """Call `load_builtins` with `xonsh_execer`""" load_builtins(execer=xonsh_execer) builtins.__xonsh_env__ = Env({'PATH': [], 'PATHEXT': []}) yield diff --git a/tests/test_ptk_history.py b/tests/test_ptk_history.py index 54128b606..800fe118b 100644 --- a/tests/test_ptk_history.py +++ b/tests/test_ptk_history.py @@ -1,3 +1,4 @@ +import pytest try: import prompt_toolkit