Ask Your Question
1

UnitTest & code coverage

asked 2018-04-09 04:35:00 -0500

updated 2019-03-13 08:31:47 -0500

Wingware Admin gravatar image

Hi!

I'm trying to set up test execution.There is a difficult moment. Tests must be performed to configure code coverage for my application Mebel.exe, which is already a Python interpreter. Wing does not allow me to select it as an interpreter because the name must be python. Can I somehow to configure the execution of unit testing by calling my interpreter is named mebel.exe?

Thank You!

edit retag flag offensive close merge delete

Comments

I made my app start using the launch configuration.But yet I get the error. Traceback (most recent call last):

  File "C:\Program Files (x86)\Wing IDE 6.0\src/testing/runners/run_unittests_xml.py", line 177, in <module>
    main(list(sys.argv))
  File "C:\Program Files (x86)\Wing IDE 6.0\src/testing/runners/run_unittests_xml.py", line 87, in main
    xmlout = wingtest_common.CreateOutputStream(argv)
  File "C:\Program Files (x86)\Wing IDE 6.0\src/testing/runners\wingtest_common.py", line 689, in CreateOutputStream
    xmlout = xml_stream_cls(raw_stream)
  File "C:\Program Files (x86)\Wing IDE 6.0\src/testing/runners\wingtest_common.py", line 101, in __init__
    self.write_raw('<%s>' % self._top_tag)
  File "C:\Program Files (x86)\Wing IDE 6.0\src/testing/runners\wingtest_common.py", line 154, in write_raw
    self._raw_stream.write(s)
TypeError: must be str, not bytes
Python: Ошибка запуска скрипта C:\Program Files (x86)\Wing IDE 6.0\src/testing/runners/run_unittests_xml.py​
Alexander Dragunkin gravatar imageAlexander Dragunkin ( 2018-04-09 05:23:00 -0500 )edit

Does it do the same thing if you debug the test from the Testing tool instead?  If so, what is in s?  It should just be an ascii tag name so the error is not yet making sense to me.

Wingware Support gravatar imageWingware Support ( 2018-04-09 09:32:00 -0500 )edit

Error on the side of my application. I will look for solutions.

Alexander Dragunkin gravatar imageAlexander Dragunkin ( 2018-04-09 15:38:00 -0500 )edit

2 Answers

Sort by » oldest newest most voted
1

answered 2018-04-09 09:31:00 -0500

It should be possible to pick any file for the Python Executable, even if named something like mebel.exe.  Wing then tries to run it to validate that it's Python and shows errors if it's not.  From your comment it sounds like you got that working.  I'll follow up on the second problem above.

edit flag offensive delete link more
0

answered 2018-04-11 03:57:00 -0500

updated 2019-03-07 09:12:18 -0500

Wingware Admin gravatar image

Hi!

I want to understand if I can use the tests tool of the Wing IDE to run test programs in my application. I can run TestRuner.py from the Windows command prompt, run the following code.

So I can run the same code by configuring the "OS Commands" tool in the appropriate configuration.

I want to use the "Testing" tool to get a report in the corresponding WIng IDE window, but I don't think I can configure it correctly.

Maybe I'm asking stupid questions! Please forgive me!Thank you for any tips on how to organize unit testing with code coverage by my app.

edit flag offensive delete link more

Comments

I think if you set Python Options (below Python Executable, same dialog/tab) to -m it'll run with the same arguments as from command line or OS Commands.However, I don't know what test framework is being used.  If it's unittest, doctest, nose, or pytest then Wing should be able to run the test from the Testing tool.  If it's something else then a new test runner would be needed.  You can see the existing ones in src/testing/runners in your Wing installation, in case that helps any.

Wingware Support gravatar imageWingware Support ( 2018-04-11 08:22:00 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2018-04-09 04:35:00 -0500

Seen: 82 times

Last updated: Mar 07