baweaver / psutil

Automatically exported from code.google.com/p/psutil
Other
0 stars 0 forks source link

Unit test code itself for test_name fails on Python 3.2 #271

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.  Run unit tests under Python 3.2, with actual python binary python3.2mu, 
symlinked from python3.2.

What is the expected output?
test_name (__main__.TestCase) ... ok

What do you see instead?
FAIL: test_name (__main__.TestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/test_psutil.py", line 851, in test_name
    os.path.basename(sys.executable).lower())
AssertionError: 'python3.2mu' != 'python3.2'
- python3.2mu
?          --
+ python3.2

What version of psutil are you using? What Python version?

0.4.1, Python 3.2

On what operating system? Is it 32bit or 64bit version?

Debian Sid/Wheezy, 64 bit Linux kernel 3.2

Please provide any additional information below.

Looks like a bug in your test code for Python 3, as actual binary has postfix 
depending on how it was compiled re thread support etc.

Original issue reported on code.google.com by matthewg...@gmail.com on 1 Jun 2012 at 3:21

GoogleCodeExporter commented 8 years ago
What if you resolve the symlink like this? Does it work?

    def test_name(self):
        sproc = get_test_subprocess(PYTHON)
        wait_for_pid(sproc.pid)
        pyexe = os.path.basename(os.path.realpath(sys.executable)).lower()
        self.assertEqual(psutil.Process(sproc.pid).name.lower(), pyexe)

Original comment by g.rodola on 2 Jun 2012 at 1:16

GoogleCodeExporter commented 8 years ago
Ok I'm able to reproduce the issue now.
Fixed in r1333.

Original comment by g.rodola on 2 Jun 2012 at 8:32

GoogleCodeExporter commented 8 years ago
0.5.0 is finally out. Closing out as fixed.

Original comment by g.rodola on 27 Jun 2012 at 6:54

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Updated csets after the SVN -> Mercurial migration:
r1333 == revision ???

Original comment by g.rodola on 2 Mar 2013 at 12:08