mercredi 27 avril 2016

how to collect py.test test

I have the following test:

class TestPytest(unittest.TestCase):
  @pytest.mark.sanity
  @pytest.mark.parametrize("test_input,expected", [("3+5", 5), ("2+4", 6), ("6*9", 80)])
  def test_eval(self, test_input, expected):
    assert eval(test_input) == expected

I invoke pytest (from another directory): pytest.main(" -v -m sanity") and I don't get any result.

This test works if I invoke py.test from the same directory, but I wish to run this test from a different directory without using a configuration file.

How can I do it?

Aucun commentaire:

Enregistrer un commentaire