Hi,

In my project there are some API tests(with pytest) like following:

/api_test
   test_device_api01_via_lan.py
   test_device_api02_via_lan.py
   test_device_api03_via_lan.py

   test_device_api01_via_wan.py
   test_device_api02_via_wan.py
   test_device_api03_via_wan.py

As you see and you may guess, yes...the two set of test_*.py have the
almost the same code, except they use the different global variable, one is
LAN_URL the other is WAN_URL, looks stupid, right? :(

So I want to refactor it, I think the two set of tests should not be
seperated just because of an variable.

but there's another problem, this test project run with Jenkins, launched
by "python3 -m py.test --junitxml=./result/api_test_result.xml",so that
Jenkins can collect the JUnit formate xml file.

I think I easily to launch the tests in loop by giving LAN_URL and WAN_URL,
but I didn't figure out how to generate a JUnit XML file in this way, can
someone please share some ideas?

Thanks,
Reed
_______________________________________________
pytest-dev mailing list
pytest-dev@python.org
https://mail.python.org/mailman/listinfo/pytest-dev

Reply via email to