By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,001 Members | 1,262 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,001 IT Pros & Developers. It's quick & easy.

strange permission issue with nosetests

P: n/a
Hi,
I'm trying the nose testing package. I've just started reading the
tutorial and I had a problem with the first simple example.

This is the test:

def test_b():
assert 'b' == 'b'

In the same directory I gave the command nosetests and it runs the test.

Then I try with nosetests -v, but it just says this:

----------------------------------------------------------------------
Ran 0 tests in 0.003s

OK

I thought because I didn't change anything in the file, don't know.
Tried to change, but nothing. I moved on and wrote another test,
inside a class, but nothing. It just doesn't run tests.

Searching on google I found this: http://www.siafoo.net/article/61
He had the same issue and said to change permission of the file to 664.

I tried and it worked.
Is that normal? Why does it happen?
Nov 20 '08 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Mr.SpOOn <mr********@gmail.comwrites:
Searching on google I found this: http://www.siafoo.net/article/61
He had the same issue and said to change permission of the file to 664.

I tried and it worked.
Is that normal? Why does it happen?
If a file is meant to be run as a command or program, make it
executable. (It would be good to *also* make the file behave well when
imported as a module instead.)

If it's meant to be imported as a module, do *not* make it executable.

Unit test modules, which are primarily meant to be imported and have
the tests collected and *then* run by the unit test framework, should
be non-executable modules. I'm very glad nose enforces this.

--
\ “Humanity has advanced, when it has advanced, not because it |
`\ has been sober, responsible, and cautious, but because it has |
_o__) been playful, rebellious, and immature.” —Tom Robbins |
Ben Finney
Nov 20 '08 #2

P: n/a
On Thu, Nov 20, 2008 at 13:34, Ben Finney
<bi****************@benfinney.id.auwrote:
Mr.SpOOn <mr********@gmail.comwrites:
>Searching on google I found this: http://www.siafoo.net/article/61
He had the same issue and said to change permission of the file to 664.

Unit test modules, which are primarily meant to be imported and have
the tests collected and *then* run by the unit test framework, should
be non-executable modules. I'm very glad nose enforces this.
Mmm it seems strange to me. I mean, there isn't any reference to this
on the site. How would one imagine he needs to change permission? And
it is strange that the first time I didn't need to change anything.
Nov 20 '08 #3

P: n/a
Mr.SpOOn <mr********@gmail.comwrites:
Mmm it seems strange to me. I mean, there isn't any reference to this
on the site. How would one imagine he needs to change permission? And
it is strange that the first time I didn't need to change anything.
This seems now to have moved to be more about the specifics of ‘nose’,
rather than about Python. Perhaps it started there. Regardless, it's
probably best to take these questions to a more focused community,
such as the developers themselves.

--
\ “Men never do evil so completely and cheerfully as when they do |
`\ it from religious conviction.” —Blaise Pascal (1623-1662), |
_o__) Pensées, #894. |
Ben Finney
Nov 20 '08 #4

P: n/a
Mr.SpOOn schreef:
On Thu, Nov 20, 2008 at 13:34, Ben Finney
<bi****************@benfinney.id.auwrote:
>Mr.SpOOn <mr********@gmail.comwrites:
>>Searching on google I found this: http://www.siafoo.net/article/61
He had the same issue and said to change permission of the file to 664.
Unit test modules, which are primarily meant to be imported and have
the tests collected and *then* run by the unit test framework, should
be non-executable modules. I'm very glad nose enforces this.

Mmm it seems strange to me. I mean, there isn't any reference to this
on the site. How would one imagine he needs to change permission? And
it is strange that the first time I didn't need to change anything.
You can also nosetests --exe; with that option, nose will also include
executable files (see the section "nosetests usage" on the website
(http://somethingaboutorange.com/mrl/...ts/nose/#usage, under
"Options")).

It took me a while too before I could figure what was wrong, and how to
solve it.

--
The saddest aspect of life right now is that science gathers knowledge
faster than society gathers wisdom.
-- Isaac Asimov

Roel Schroeven
Nov 20 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.