8000 [luigi.mock.MockFile] removed by drowoseque · Pull Request #2839 · spotify/luigi · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[luigi.mock.MockFile] removed #2839

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions luigi/mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
from io import BytesIO

import sys
import warnings

from luigi import six
from luigi import target
Expand Down Expand Up @@ -188,9 +187,3 @@ def seekable(self):
return wrapper
else:
return self.format.pipe_reader(Buffer(self.fs.get_all_data()[fn]))


class MockFile(MockTarget):
def __init__(self, *args, **kwargs):
warnings.warn("MockFile has been renamed MockTarget", DeprecationWarning, stacklevel=2)
super(MockFile, self).__init__(*args, **kwargs)
12 changes: 0 additions & 12 deletions test/mock_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from helpers import unittest

from luigi.mock import MockTarget, MockFileSystem
from luigi import six
from luigi.format import Nop


Expand Down Expand Up @@ -116,14 +115,3 @@ def test_rename(self):

def test_listdir(self):
self.assertEqual(sorted([self.path, self.path2]), sorted(self.fs.listdir("/tmp")))


class TestImportMockFile(unittest.TestCase):

def test_mockfile(self):
from luigi.mock import MockFile
if six.PY3:
with self.assertWarnsRegex(DeprecationWarning, r'MockFile has been renamed MockTarget'):
self.assertTrue(isinstance(MockFile('foo'), MockTarget))
else:
self.assertTrue(isinstance(MockFile('foo'), MockTarget))
0