First time here? Check out the FAQ!
1

UnitTest & code coverage

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!

Alexander Dragunkin's avatar
11
Alexander Dragunkin
asked 2018-04-09 04:35:00 -0500
Wingware Admin's avatar
231
Wingware Admin
updated 2019-03-13 08:31:47 -0500
edit flag offensive 0 remove flag 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's avatar Alexander 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's avatar Wingware Support (2018-04-09 09:32:00 -0500) edit

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

Alexander Dragunkin's avatar Alexander Dragunkin (2018-04-09 15:38:00 -0500) edit
add a comment see more comments

2 Answers

1

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.

Wingware Support's avatar
4.1k
Wingware Support
answered 2018-04-09 09:31:00 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments
0

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.

Alexander Dragunkin's avatar
11
Alexander Dragunkin
answered 2018-04-11 03:57:00 -0500
Wingware Admin's avatar
231
Wingware Admin
updated 2019-03-07 09:12:18 -0500
edit flag offensive 0 remove flag delete link

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's avatar Wingware Support (2018-04-11 08:22:00 -0500) edit
add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer