How Run Py.test from PyScripter

Discussion in 'Python' started by san, Nov 14, 2012.

  1. san

    san Guest

    I am a newbie to py.test , Please let me know how to run the py.test in PyScripter Editor. I have tried in the belwo way but it doesn't work.

    import pytest

    def func(x): return x + 1

    def test_answer(): assert func(3) == 5

    pytest.main()

    below is the Exception that i get

    Traceback (most recent call last):
    File "<module1>", line 10, in <module>
    File "C:\Python27\lib\site-packages\pytest-2.3.2-py2.7.egg\_pytest\core.py", line 474, in main
    exitstatus = config.hook.pytest_cmdline_main(config=config)
    File "C:\Python27\lib\site-packages\pytest-2.3.2-py2.7.egg\_pytest\core.py", line 422, in __call__
    return self._docall(methods, kwargs)
    File "C:\Python27\lib\site-packages\pytest-2.3.2-py2.7.egg\_pytest\core.py", line 433, in _docall
    res = mc.execute()
    File "C:\Python27\lib\site-packages\pytest-2.3.2-py2.7.egg\_pytest\core.py", line 351, in execute
    res = method(**kwargs)
    File "C:\Python27\lib\site-packages\pytest-2.3.2-py2.7.egg\_pytest\main.py", line 107, in pytest_cmdline_main
    return wrap_session(config, _main)
    File "C:\Python27\lib\site-packages\pytest-2.3.2-py2.7.egg\_pytest\main.py", line 92, in wrap_session
    config.pluginmanager.notify_exception(excinfo, config.option)
    File "C:\Python27\lib\site-packages\pytest-2.3.2-py2.7.egg\_pytest\core.py", line 285, in notify_exception
    res = self.hook.pytest_internalerror(excrepr=excrepr)
    File "C:\Python27\lib\site-packages\pytest-2.3.2-py2.7.egg\_pytest\core.py", line 422, in __call__
    return self._docall(methods, kwargs)
    File "C:\Python27\lib\site-packages\pytest-2.3.2-py2.7.egg\_pytest\core.py", line 433, in _docall
    res = mc.execute()
    File "C:\Python27\lib\site-packages\pytest-2.3.2-py2.7.egg\_pytest\core.py", line 351, in execute
    res = method(**kwargs)
    File "C:\Python27\lib\site-packages\pytest-2.3.2-py2.7.egg\_pytest\terminal.py", line 152, in pytest_internalerror
    self.write_line("INTERNALERROR> " + line)
    File "C:\Python27\lib\site-packages\pytest-2.3.2-py2.7.egg\_pytest\terminal.py", line 140, in write_line
    self._tw.line(line, **markup)
    File "C:\Python27\lib\site-packages\py-1.4.11-py2.7.egg\py\_io\terminalwriter.py", line 181, in line
    self.write(s, **kw)
    File "C:\Python27\lib\site-packages\py-1.4.11-py2.7.egg\py\_io\terminalwriter.py", line 225, in write
    self._file.write(msg)
    File "C:\Python27\lib\site-packages\py-1.4.11-py2.7.egg\py\_io\terminalwriter.py", line 241, in write
    self._writemethod(data)
    TypeError: 'AsyncStream' object is not callable
    san, Nov 14, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gigs_

    pyscripter

    Gigs_, Feb 14, 2007, in forum: Python
    Replies:
    1
    Views:
    489
    PyScripter
    Feb 15, 2007
  2. Gigs_

    pyscripter

    Gigs_, Feb 28, 2007, in forum: Python
    Replies:
    1
    Views:
    359
    Gabriel Genellina
    Mar 1, 2007
  3. gigs

    pyscripter on windows vista

    gigs, Apr 4, 2007, in forum: Python
    Replies:
    0
    Views:
    315
  4. Gigs_

    pyscripter to slow

    Gigs_, May 3, 2007, in forum: Python
    Replies:
    1
    Views:
    294
    Larry Bates
    May 3, 2007
  5. RichSaneSwindler

    Pyscripter

    RichSaneSwindler, Aug 5, 2007, in forum: Python
    Replies:
    2
    Views:
    752
    RichSaneSwindler
    Aug 6, 2007
Loading...

Share This Page