question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Python: Run Current Unit Test File throws error if junitxml argument is used

See original GitHub issue

Issue Type: Bug

  1. Create a simple Pytest project and add argument “–junitxml=abc.xml”
  2. Run command Python: Run Current Unit Test File

Observed:

============================= test session starts =============================
platform win32 -- Python 3.7.0, pytest-3.7.1, py-1.5.4, pluggy-0.7.1
rootdir: d:\Working\simple_project, inifile: pytest.ini
plugins: metadata-1.7.0, html-1.19.0
collected 1 item

tests\test_simple_mapping.py .                                           [100%]

 generated xml file: d:\Working\simple_project\abc.xml 
========================== 1 passed in 0.05 seconds ===========================
Error: Error: ENOENT: no such file or directory, open 'D:\Dev_Tools\Microsoft VS Code\abc.xml'

Expected: No issue happen

Extension version: 2018.7.1 VS Code version: Code 1.26.0 (4e9361845dc28659923a300945f84731393e210d, 2018-08-13T16:29:31.933Z) OS version: Windows_NT x64 10.0.17134

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:15 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
brettcannoncommented, Aug 20, 2018

I assume this works if you run this from the command-line with the same Python environment?

1reaction
brettcannoncommented, Sep 10, 2018

[ @trinhpham I edited your ✉️ ⬆️ to come off as more 😃 and less 😠 ]

Read more comments on GitHub >

github_iconTop Results From Across the Web

unittest — Unit testing framework — Python 3.11.1 ...
The unittest module can be used from the command line to run tests from modules, ... If the setUp() method raises an exception...
Read more >
Python, Passing --junitxml to pytest.main() - Stack Overflow
I want to use the already existing option. I want my pytest.main() call to be supplied with --junitxml argument so that the test...
Read more >
Usage and Invocations — pytest documentation
This will run tests which contain names that match the given string expression (case-insensitive), which can include Python operators that use filenames, ...
Read more >
Outputting XML Test Reports — nose2 0.12.0 documentation
By default, the report is written to a file called nose2-junit.xml in the current working directory. You can configure the output filename by...
Read more >
Coverage.py — Coverage.py 7.0.1 documentation
Coverage.py is a tool for measuring code coverage of Python programs. It monitors your program, ... Use coverage run to run your test...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found