Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the ability to set set_attribute #227

Open
klookAppTest opened this issue Aug 27, 2020 · 1 comment
Open

Added the ability to set set_attribute #227

klookAppTest opened this issue Aug 27, 2020 · 1 comment
Labels
needs_5_whys request is unclear and needs more information as to why we need the change

Comments

@klookAppTest
Copy link

I need to customize the attribute in the case

For example

import unittest
import xmlrunner
from xmlrunner.result import set_attribute


class TestSequenceFunctions(unittest.TestCase):

    def test_sample(self):
        set_attribute({"jira": "0001", "case_id": "1001"})


if __name__ == '__main__':
    with open('./results.xml', 'wb') as output:
        unittest.main(
            testRunner=xmlrunner.XMLTestRunner(output=output),
            failfast=False, buffer=False, catchbreak=False)

result.xml

<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
	<testsuite errors="0" failures="0" file=".py" name="TestSequenceFunctions-20200827100320" skipped="0" tests="1" time="0.007" timestamp="2020-08-27T10:03:20">
		<testcase case_id="1001" classname="TestSequenceFunctions" file="best_sample.py" jira="0001" line="9" name="test_sample" time="0.007" timestamp="2020-08-27T10:03:20">
			<system-out>
<![CDATA[{"jira": "0001", "case_id": "1001"}]]>			</system-out>
		</testcase>
	</testsuite>
</testsuites>
@dnozay
Copy link
Member

dnozay commented Nov 16, 2020

I need to customize the attribute in the case

@klookAppTest , can you please go through the 5 whys (https://en.wikipedia.org/wiki/Five_whys) exercise and explain better what you are trying to do?

if all you need is print something on stdout, you can already do that.

@dnozay dnozay added the needs_5_whys request is unclear and needs more information as to why we need the change label Nov 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs_5_whys request is unclear and needs more information as to why we need the change
Projects
None yet
Development

No branches or pull requests

2 participants