Giter Club home page Giter Club logo

Comments (24)

timbertson avatar timbertson commented on June 29, 2024

it works fine for me. What python version & OS are you running?

can you run it with the --console flag to see if it's specific to the GTK code?

I just did the following (after installing the virtualenv python package). Could you please let me know if it works after trying this?
(virtualenv will create a "fresh" python install, eliminating interference from other packages)

mkdir /tmp/autonose_test
virtualenv --no-site-packages /tmp/autonose_test/
cd /tmp/autonose_test/
./bin/easy_install autonose
mkdir proj
cd proj
echo -e 'def test_print():\n\tprint "test"\n\tassert False\n' > test_print.py 
../bin/autonose --console

from autonose.

decitrig avatar decitrig commented on June 29, 2024

Haven't run the code yet, but that was with the --console flag; I haven't gotten GTK to work yet.

from autonose.

decitrig avatar decitrig commented on June 29, 2024

Sorry it took so long. I did what you suggested, and everything went fine, except the stdout was not captured and displayed.

from autonose.

decitrig avatar decitrig commented on June 29, 2024

Also, python 2.6.4 and ArchLinux

from autonose.

antlong avatar antlong commented on June 29, 2024

A fix:

capture.py - line 74:

def formatError(self, test, err):
    """Add captured output to error report.
    """
    test.capturedOutput = output = self.buffer
    #self._buf = None

comment out self._buf = None

Also - for good measure, change:

from StringIO import StringIO

to-

from cStringIO import StringIO

from autonose.

timbertson avatar timbertson commented on June 29, 2024

antlong:

thanks very much for tracking that down! I've added --nocapture to the nose options in the latest commit, does that fix the issue?

As for the capture.py plugin, do you have any plans to submit this to the nose developers? I can't really do much about it in autonose (except disable the plugin altogether)

from autonose.

antlong avatar antlong commented on June 29, 2024

yeah, it will fix it short term. i sent an email to ned of coverage. i will follow up when he replies accordingly.

from autonose.

nedbat avatar nedbat commented on June 29, 2024

Hi guys, I'd like to help, but I'm at a bit of a loss. How is coverage.py involved in this?

from autonose.

antlong avatar antlong commented on June 29, 2024

isnt the capture.py plugin coverage? maybe im just really confused. if its not yours, im sorry to bother you :)

from autonose.

nedbat avatar nedbat commented on June 29, 2024

Nope: the coverage plugin is called cover.py, and I didn't write that one either! :)

from autonose.

antlong avatar antlong commented on June 29, 2024

ok ned thank you :)

gfxmonk, i think the best approach would be to disable it, for now. I made a ticket on nose's tracker but im not sure how long it would take to get upstream.

from autonose.

timbertson avatar timbertson commented on June 29, 2024

So I finally actually experienced this problem for myself, and it does not appear to be the fault of the capture plugin (although for autonose it still does make sense to disable this plugin).

The problem is in the deletion of modules. In runner.py, there are two functions: save_init_modules and restore_init_modules. The first takes a snapshot of imported modules just before the tests run; the second reverts the set of loaded modules to that original set, using the code del(sys.modules[modname]).

This has the effect (in theory) of causing all modules imported by the files under test to be re-imported, ensuring the latest version is always run when nosetests kicks off.

It seems StringIO is special somehow, and I can't say how, but its module-level function _complain_ifclosed seems to get set to None in this process. For now, I've added an import in save_init_modules so that it will not get removed. This isn't ideal, but I certainly can't think of a better idea...

I'm going to call this issue closed, but please let me know if you still experience this problem in the latest version (0.1.4) and I'll reopen it.

from autonose.

timbertson avatar timbertson commented on June 29, 2024

(closing)

from autonose.

antlong avatar antlong commented on June 29, 2024

cstringIO is a faster version of stringIO. it does have a few smaller differences, such as the module is not able to accept Unicode strings that cannot be encoded as plain ASCII strings, and it will create a read only object while stringIO creates a r+w object.

In this case, im not sure that we would write anyway, so cstringIO is the better choice for the performance boost.

from autonose.

timbertson avatar timbertson commented on June 29, 2024

erm, not quite sure what you're getting at. I don't actually use StringIO in autonose, but the capture plugins do (so it's not my choice, nor is it always correct to assume that cstringIO is present).

If cstringIO has the same problem we can add that to the list of modules to never delete, but I don't think that's necessary.

from autonose.

teleyinex avatar teleyinex commented on June 29, 2024

Hi,

I'm running version 0.2.2 and I cannot get the stdout. Has this been solved?

from autonose.

timbertson avatar timbertson commented on June 29, 2024

Can you paste a stack trace or something? Or do you get the same results as the original reporter? I thought this was fixed, but perhaps not...

from autonose.

teleyinex avatar teleyinex commented on June 29, 2024

What I do not see is the stdout from running nosetest test.py when one test fails. I do not get any error, the problem is that there is nothing reported in the autonose console. Do I send you an output file from autonose --debug?

from autonose.

timbertson avatar timbertson commented on June 29, 2024

Yeah, that ought to do :)

from autonose.

teleyinex avatar teleyinex commented on June 29, 2024

@gfxmonk Here you have the output from a failed test: http://paste.ubuntu.com/942110/

from autonose.

timbertson avatar timbertson commented on June 29, 2024

Hmm, Is that the whole thing? There's only one stacktrace line right
at the end, and it doesn't tell me much I'm afraid :/

from autonose.

teleyinex avatar teleyinex commented on June 29, 2024

This is a new one http://paste.ubuntu.com/943730/ with the traceback.print_stack() after forcing a test to fail.

from autonose.

timbertson avatar timbertson commented on June 29, 2024

Thanks for the full log, I'm thinking that's a different bug - I've experienced it myself, but not been able to figure out what it could be (admittedly I've not looked too hard, as I don't use autonose much myself). I've opened issue #24 to track this.

from autonose.

teleyinex avatar teleyinex commented on June 29, 2024

You are welcome :)

from autonose.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.