I'm running into a weird problem where running blender from the command line will run with the --background flag, but it's not recognizing the --python flag. Any thoughts?
This is the output of my current directory: .
The script I'm running is the script found here
import unittest
class TestStringMethods(unittest.TestCase):
def test_upper(self):
self.assertEqual('foo'.upper(), 'FOO')
def test_isupper(self):
self.assertTrue('FOO'.isupper())
self.assertFalse('Foo'.isupper())
def test_split(self):
s = 'hello world'
self.assertEqual(s.split(), ['hello', 'world'])
# check that s.split fails when the separator is not a string
with self.assertRaises(TypeError):
s.split(2)
if __name__ == '__main__':
unittest.main()
Thanks!
usage
. Could you please check if using./blender --factory-startup --background --python ./unit_test_example.py
works correctly? Could it be that you have third-party add-ons or Python packages installed? $\endgroup$parser.parse_args()
ie. trying to interpret all Blender's arguments as it's own arguments. See eg this. Post your script. $\endgroup$import unittest class TestStringMethods(unittest.TestCase): def test_upper(self): self.assertEqual('foo'.upper(), 'FOO') def test_isupper(self): self.assertTrue('FOO'.isupper()) self.assertFalse('Foo'.isupper()) def test_split(self): s = 'hello world' self.assertEqual(s.split(), ['hello', 'world']) # check that s.split fails when the separator is not a string with self.assertRaises(TypeError): s.split(2) if __name__ == '__main__': unittest.main()
$\endgroup$