mirror of
				https://github.com/python-escpos/python-escpos
				synced 2025-10-23 09:30:00 +00:00 
			
		
		
		
	remove nose from test_cli
This commit is contained in:
		@@ -6,7 +6,6 @@
 | 
				
			|||||||
import os
 | 
					import os
 | 
				
			||||||
import pytest
 | 
					import pytest
 | 
				
			||||||
from scripttest import TestFileEnvironment
 | 
					from scripttest import TestFileEnvironment
 | 
				
			||||||
from nose.tools import nottest
 | 
					 | 
				
			||||||
import escpos
 | 
					import escpos
 | 
				
			||||||
 | 
					
 | 
				
			||||||
TEST_DIR = os.path.abspath("test/test-cli-output")
 | 
					TEST_DIR = os.path.abspath("test/test-cli-output")
 | 
				
			||||||
@@ -15,15 +14,13 @@ DEVFILE_NAME = "testfile"
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
DEVFILE = os.path.join(TEST_DIR, DEVFILE_NAME)
 | 
					DEVFILE = os.path.join(TEST_DIR, DEVFILE_NAME)
 | 
				
			||||||
CONFIGFILE = "testconfig.yaml"
 | 
					CONFIGFILE = "testconfig.yaml"
 | 
				
			||||||
CONFIG_YAML = """
 | 
					CONFIG_YAML = f"""
 | 
				
			||||||
---
 | 
					---
 | 
				
			||||||
 | 
					
 | 
				
			||||||
printer:
 | 
					printer:
 | 
				
			||||||
    type: file
 | 
					    type: file
 | 
				
			||||||
    devfile: {testfile}
 | 
					    devfile: {DEVFILE}
 | 
				
			||||||
""".format(
 | 
					"""
 | 
				
			||||||
    testfile=DEVFILE,
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class TestCLI:
 | 
					class TestCLI:
 | 
				
			||||||
@@ -79,7 +76,9 @@ class TestCLI:
 | 
				
			|||||||
        assert not result.stderr
 | 
					        assert not result.stderr
 | 
				
			||||||
        assert escpos.__version__ == result.stdout.strip()
 | 
					        assert escpos.__version__ == result.stdout.strip()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @nottest  # disable this test as it is not that easy anymore to predict the outcome of this call
 | 
					    @pytest.mark.skip(
 | 
				
			||||||
 | 
					        reason="disable this test as it is not that easy anymore to predict the outcome of this call"
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
    def test_cli_text(self):
 | 
					    def test_cli_text(self):
 | 
				
			||||||
        """Make sure text returns what we sent it"""
 | 
					        """Make sure text returns what we sent it"""
 | 
				
			||||||
        test_text = "this is some text"
 | 
					        test_text = "this is some text"
 | 
				
			||||||
@@ -102,7 +101,7 @@ class TestCLI:
 | 
				
			|||||||
        result = self.env.run(
 | 
					        result = self.env.run(
 | 
				
			||||||
            *(self.default_args + ("text", "--invalid-param", "some data")),
 | 
					            *(self.default_args + ("text", "--invalid-param", "some data")),
 | 
				
			||||||
            expect_error=True,
 | 
					            expect_error=True,
 | 
				
			||||||
            expect_stderr=True
 | 
					            expect_stderr=True,
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
        assert result.returncode == 2
 | 
					        assert result.returncode == 2
 | 
				
			||||||
        assert "error:" in result.stderr
 | 
					        assert "error:" in result.stderr
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user