pytest-spiratest - how to obtain test case id of test within Class

Tuesday, November 27, 2018
Avatar


Here is part of my spira.cfg:

[test_cases]
test_example = 1
TestClass.test_example = 2

The problem is ConfigParser set all capital letters to lowercase by default. Therefore It's not possible to obtain test case id of TestClass.test_example within pytest-spiratest, because config["test_case_ids"] contains lowercase testclass.test_example.

if test_name in config["test_case_ids"]:
    test_case_id = config["test_case_ids"][test_name]
else:
    test_case_id = config["test_case_ids"]["default"]

 

1 Replies
Wednesday, November 28, 2018
Avatar
re: johnny_t Tuesday, November 27, 2018

Fixed by modifying pytest-spiratest package

Statistics
  • Started: Tuesday, November 27, 2018
  • Last Reply: Wednesday, November 28, 2018
  • Replies: 1
  • Views: 807