Skip to content

Commit

Permalink
See if we can fix tests on win and mac.
Browse files Browse the repository at this point in the history
  • Loading branch information
adiroiban committed Apr 12, 2022
1 parent a671985 commit a243145
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/twisted/conch/test/test_filetransfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,9 @@ def test_constantsAgainstSpec(self):
self.assertEqual(v, getattr(filetransfer, k))


# We don't run on Windows, as we don't have an SFTP file server implemented in conch.ssh for Windows.
# As soon as there is such an implementation, we can run these tests on Windows.
@skipIf(not unix, "can't run on non-posix computers")
@skipIf(not cryptography, "Cannot run without cryptography")
class RawPacketDataServerTests(TestCase):
"""
Expand Down
2 changes: 1 addition & 1 deletion src/twisted/internet/test/test_posixbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,4 +297,4 @@ def test_noWakerConstructionWarnings(self):
warnings = self.flushWarnings()
# explicitly close the sockets
waker.connectionLost(None)
self.assertEqual(len(warnings), 0)
self.assertEqual(len(warnings), 0, warnings)
3 changes: 2 additions & 1 deletion src/twisted/internet/test/test_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,8 @@ def test_openFileDescriptors(self):
# might at least hypothetically select.)

fudgeFactor = 17
unlikelyFD = resource.getrlimit(resource.RLIMIT_NOFILE)[0] - fudgeFactor
# Try not to go into negative land.
unlikelyFD = max(9, resource.getrlimit(resource.RLIMIT_NOFILE)[0] - fudgeFactor)

os.dup2(w, unlikelyFD)
self.addCleanup(os.close, unlikelyFD)
Expand Down
4 changes: 2 additions & 2 deletions src/twisted/trial/test/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,8 +634,8 @@ def test_append(self):
The log file is opened in append mode so if runner configuration specifies
an existing log file its contents are not wiped out.
"""
existingText = "Hello, world.\n"
newText = "Goodbye, world.\n"
existingText = f"Hello, world.{os.linesep} "
newText = f"Goodbye, world.{os.linesep}"
p = filepath.FilePath(self.mktemp())
with openTestLog(p) as f:
f.write(existingText)
Expand Down

0 comments on commit a243145

Please sign in to comment.