summaryrefslogtreecommitdiff
path: root/tests/test_misc.py
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #739 from swt2c/makeSuiteRed_M2023-02-141-1/+1
|\ | | | | Replace deprecated unittest.makeSuite
| * tests: Replace deprecated unittest.makeSuiteScott Talbert2023-02-021-1/+1
| | | | | | | | | | | | This function was never formally documented, but has been deprecated and will be removed in Python 3.13. Replaced with unittest.TestLoader.loadTestsFromTestCase.
* | tests: Replace assertRaisesRegexp with assertRaisesRegexScott Talbert2023-02-011-2/+2
|/ | | | | unittest.TestCase.assertRaisesRegexp was deprecated in Python 3.2 and is removed in Python 3.12.
* Always use self.PYTHONBIN not 'python' or sys.executable in tests (#580)dluyer2019-08-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | * s/sys.executable/self.PYTHONBIN/ * s/sys.executable/self.PYTHONBIN/ * Update test_isalive.py * s/sys.executable/self.PYTHONBIN/ * s/sys.executable/self.PYTHONBIN/ * Support cases where pythonbin != sys.executable * Support cases where pythonbin != sys.executable * Fix raw use of 'python' to use self.PYTHONBIN * Fix test_pxssh.py when PYTHONBIN != 'python' The fake 'ssh' will be started via #!/usr/bin/env python, when it may need to use sys.executable or some other self.PYTHONBIN. * Remove unnecessary changes from pull request. * Remove unnecessary changes from pull request.
* properly handle read timeouts with use_poll=TrueRyan Petrello2018-05-211-0/+6
| | | | see: https://github.com/pexpect/pexpect/issues/491
* Allow for configurable select.poll() usageCooper Ry Lees2018-03-231-2/+23
| | | | | | | - This allows systems that can have > 1024 fds to work - Should be marginally faster - Added tests to use select.poll() - Incremented version - Happy to change this, guessed what it should be
* FIX: bad representation of bytes patterns.Julien Palard2018-02-121-1/+1
| | | | | | | | | | | | | | | | I was getting: 0: re.compile("b'^[^\r\n]*\r?\n'") 1: re.compile("b'^--More-- or \\(q\\)uit'") 2: re.compile("b'^\\(.*\\) #'") So I decided to drop the %s and keep only the %r, which equally for str and bytes: >>> ' %d: re.compile(%r)' % (1, b'foo') " 1: re.compile(b'foo')" >>> ' %d: re.compile(%r)' % (1, 'foo') " 1: re.compile('foo')"
* Use PATH from env argument to pexpect.spawnMartin Packman2016-05-131-7/+0
| | | | | | | | | | | | | Currently pexpect.spawn takes an env argument along the lines of subprocess.Popen but fails to use PATH from that env when finding the binary to run. The result when running a binary not on the PATH of the parent process is pexpect will raise an exception, or worse, find a different binary with the same name. This change passes the env from spawn into the which function so the correct PATH is searched and adds test coverage.
* match feature with test spawn_ourptyfork kwargsJeff Quast2015-09-181-2/+4
|
* Merge pull request #164 from takluyver/contextmanagerJeff Quast2014-12-191-0/+10
|\ | | | | Allow spawn() and friends to be used as context managers
| * Allow spawn() and friends to be used as context managersThomas Kluyver2014-12-191-0/+10
| | | | | | | | Closes gh-111
* | Update test case for preexec_fnThomas Kluyver2014-12-191-2/+2
|/
* Set default signal handlers for SIGINT and SIGHUP.Jeff Quast2014-11-231-34/+17
| | | | | | | According to test_misc.py comments, fedora's build agent has the same problem as ours. We use the setUp and tearDown methods to set and restore these signals, if ignored.
* Delegate more methods to ptyprocessThomas Kluyver2014-11-231-1/+1
|
* Incremental housekeeping cleanup of test_misc.pyjquast2014-06-281-161/+198
| | | | | | | | | | | | | | | - standard/local import grouping - docstring every test - pep8 formatting - remove custom assertion messages - Separate tests to individual groups - Remove unnecessary time.sleep() calls - use echo=False parameter, avoiding testing combinations of mixed input+output, and removing the need to document this strange combination. - programmatically test searcher_re/_string - prefer assertRaises/assertRaisesRegexp - use tempfile.gettempdir() instead of /tmp
* Miscellaneous minor fixesThomas Kluyver2014-06-151-1/+1
|
* Solaris support, tested on SmartOS from cron(1).Jeff Quast2014-06-151-20/+19
|
* Merge pull request #70 from pexpect/more-exacting-whichThomas Kluyver2014-06-101-76/+0
|\ | | | | new function is_exe() makes existing which() more correct
| * Separate which tests into test_which.pyjquast2014-06-071-76/+0
| |
* | PR #66: TypeError thrown by spawnu.readline()jquast2014-06-081-0/+7
|/ | | | | | | | Submitted by @auntieNeo, fixes exception, "TypeError: got <type 'str'> ('\r\n') as pattern" in spawnu.readline(). Bytes b'\r\n' was concatenated to u'unicode', causing an exception to be thrown when using readline().
* Fix imports in tests for Python 3Thomas Kluyver2014-06-011-1/+1
| | | | Closes gh-59
* remove all unnecessary importsjquast2014-06-011-1/+0
|
* folders should not be returned by pexpect.which()jquast2014-06-011-1/+64
|
* Make test_sighup robust against a parent process ignoring SIGHUPThomas Kluyver2013-11-041-16/+33
| | | | | | Fedora build machines call signal.signal(signal.SIGHUP, signal.SIG_IGN) as part of daemonizing, but this test needs the child process to use the default signal handler.
* Test and fix getting tracebacks excluding pexpect codeThomas Kluyver2013-10-211-0/+11
|
* Test our own pty fork implementationThomas Kluyver2013-10-211-0/+11
|
* Call readlines() before stdout is discardedThomas Kluyver2013-10-091-3/+4
| | | | Closes gh-12 (hopefully)
* Improve test for setting and retrieving window sizebetter-test-winsizeThomas Kluyver2013-10-091-4/+0
|
* Add test for ignore_sighup optionThomas Kluyver2013-10-081-2/+21
|
* Minor fixes to some testsThomas Kluyver2013-09-261-2/+2
|
* Don't use six for testsThomas Kluyver2013-09-231-26/+25
|
* Fix SyntaxError in test_miscThomas Kluyver2013-09-231-1/+1
|
* add note about line buffering, add sleep timersjquast2013-09-231-7/+17
|
* correct use of % formatting tuple,jquast2013-09-231-2/+2
|
* add missing import (time)jquast2013-09-231-0/+1
|
* another syntaxerror fix, missing end parenjquast2013-09-231-1/+1
|
* fix assertions to display what failed assertion!jquast2013-09-231-8/+34
|
* display error fix and brevity of childexit assrtsjquast2013-09-221-4/+4
|
* assert child exitcodejquast2013-09-221-0/+2
|
* exitstatus fixjquast2013-09-221-1/+1
|
* assert child exit statusjquast2013-09-221-0/+2
|
* py2.5 compatibilities w/six.pyjquast2013-09-221-24/+25
| | | | | | | | | | -except Exception as e: +except Exception, err: the unfortunate use of six.b('') instead of b'' print(arg0, arg1) => six.print_(arg0, arg1) some autopep8 -i is definitely called for, some of these test cases are darn unreadable, but did partially pep8 some of the really-long-over-80col-lines.
* more py25 compatibilityjquast2013-09-221-0/+1
| | | | not even sure if pexpect can get as far back as python2.5, but its worth a shot.
* smartly use .replace & remove 'io' dep. for py2jquast2013-09-221-11/+5
| | | | here goes backwards compatibility testing for py2 versions -- though I have them all locally, trying for travis CI which would help identify problems going forward. I'm sure there is some six.PY3 things to work out yet, already noticed I need a from __future__ import for the 'with' contextmanager for python 2.5.
* cat(1) may display ^D\x08\x08 when ^D is used.jquast2013-09-221-1/+11
| | | | This causes various tests, that depend on cat(1) to fail on Mac OSX 10.8.5. These changes ensure that if ^D\x08\x08 ('^D', followed by '\b\b') is found, it is removed.
* Changes towards Python 3 compatibility.Thomas Kluyver2013-09-171-27/+40
|
* Use new style except statements in testsThomas Kluyver2013-09-171-5/+5
|
* Fix assertions that couldn't have failedThomas Kluyver2013-01-041-12/+10
|
* Moved everything up one directory level.Noah Spurrier2012-10-261-0/+217