strange permission issue with nosetests

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mr.SpOOn

    strange permission issue with nosetests

    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?
  • Ben Finney

    #2
    Re: strange permission issue with nosetests

    Mr.SpOOn <mr.spoon21@gma il.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

    Comment

    • Mr.SpOOn

      #3
      Re: strange permission issue with nosetests

      On Thu, Nov 20, 2008 at 13:34, Ben Finney
      <bignose+hate s-spam@benfinney. id.auwrote:
      Mr.SpOOn <mr.spoon21@gma il.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.

      Comment

      • Ben Finney

        #4
        Re: strange permission issue with nosetests

        Mr.SpOOn <mr.spoon21@gma il.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

        Comment

        • Roel Schroeven

          #5
          Re: strange permission issue with nosetests

          Mr.SpOOn schreef:
          On Thu, Nov 20, 2008 at 13:34, Ben Finney
          <bignose+hate s-spam@benfinney. id.auwrote:
          >Mr.SpOOn <mr.spoon21@gma il.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

          Comment

          Working...