Git Product home page Git Product logo

Comments (9)

leifwalsh avatar leifwalsh commented on August 17, 2024

...is sys.executable somehow “sysctl”?

from marbles.

thejunglejane avatar thejunglejane commented on August 17, 2024

So I had that thought, but it appears not to be? Also, all the other tests pass...

(marbles-rOKSo-69) jane@19:06:40 core (master *) $ python -m unittest tests.test_main.VersionTestCase.test_stderr
['/Users/jane/Environments/marbles-rOKSo-69/bin/python', '-m', 'marbles', '--version']
F
======================================================================
FAIL: test_stderr (tests.test_main.VersionTestCase)
The error output should be empty.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/jane/Development/marbles/marbles/core/tests/test_main.py", line 255, in test_stderr
    self.assertEqual('', self.stderr)
AssertionError: '' != 'sh: sysctl: command not found\n'
+ sh: sysctl: command not found


----------------------------------------------------------------------
Ran 1 test in 0.350s

FAILED (failures=1)
(marbles-rOKSo-69) jane@19:06:48 core (master *) $ git diff tests/test_main.py
diff --git a/marbles/core/tests/test_main.py b/marbles/core/tests/test_main.py
index 2b9deca..507a4ff 100644
--- a/marbles/core/tests/test_main.py
+++ b/marbles/core/tests/test_main.py
@@ -251,6 +251,7 @@ class VersionTestCase(CommandRunningTestCase):
 
     def test_stderr(self):
         '''The error output should be empty.'''
+        print(self.cmd)
         self.assertEqual('', self.stderr)

from marbles.

thejunglejane avatar thejunglejane commented on August 17, 2024

I wondered if this had to do with running with/without shell=True but I got the same test failure when I tried running after making this change

(marbles-rOKSo-69) jane@19:10:06 core (master *) $ git diff tests/test_main.py
diff --git a/marbles/core/tests/test_main.py b/marbles/core/tests/test_main.py
index 2b9deca..1221d2e 100644
--- a/marbles/core/tests/test_main.py
+++ b/marbles/core/tests/test_main.py
@@ -86,7 +86,7 @@ class CommandRunningTestCase(unittest.TestCase):
             to_remove = None
         try:
             proc = subprocess.run(
-                self.cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
+                ' '.join(self.cmd), shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
                 env=env, cwd=core_dir)
         finally:
             if to_remove:
@@ -251,6 +251,7 @@ class VersionTestCase(CommandRunningTestCase):
 
     def test_stderr(self):
         '''The error output should be empty.'''
+        print(self.cmd)
         self.assertEqual('', self.stderr)

from marbles.

leifwalsh avatar leifwalsh commented on August 17, 2024

Can you run /Users/jane/Environments/marbles-rOKSo-69/bin/python -m marbles --version yourself?

from marbles.

thejunglejane avatar thejunglejane commented on August 17, 2024

Yeah, and it works fine

(marbles-rOKSo-69) jane@19:22:03 marbles (master) $ /Users/jane/Environments/marbles-rOKSo-69/bin/python -m marbles --version
marbles.core version: 0.9.2
marbles.mixins version: 0.9.2

from marbles.

leifwalsh avatar leifwalsh commented on August 17, 2024

https://stackoverflow.com/questions/42285518/sh-sysctl-command-not-found-for-mac-os-x-running-a-cron-job looks related but I don't understand what's trying to run sysctl.

from marbles.

leifwalsh avatar leifwalsh commented on August 17, 2024

https://bugs.python.org/issue11569

from marbles.

thejunglejane avatar thejunglejane commented on August 17, 2024

Yeah, sysctl is in /usr/sbin/ (which is on my $PATH) on my machine (see which sysctl in OP)

from marbles.

thejunglejane avatar thejunglejane commented on August 17, 2024

oh jeez

from marbles.

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.