Closed researcher175 closed 8 months ago
Rename Field refactoring allows you to rename a class field with class method names It would be nice if Rope sent an alert to the user to avoid call errors
Steps to reproduce the behavior:
structure
-- main ---- main.py -- test ---- test.py
main.py:
from abc import abstractmethod class BaseNPExtractor(object): @abstractmethod def extract(self, text): return class PatternTagger: def tag(self, text): return [] class ConllExtractor(BaseNPExtractor): POS_TAGGER = PatternTagger() def __init__(self, parser=None): self.parser = parser def extract(self, text): return [] def _parse_sentence(self, sentence): tagged = self.POS_TAGGER.tag(sentence) return self.parser.parse(tagged)
test.py:
from __future__ import unicode_literals import unittest from main.main import ConllExtractor class TestConllExtractor(unittest.TestCase): def setUp(self): self.extractor = ConllExtractor() self.text = 'Python is ' def test_extract(self): noun_phrases = self.extractor.extract(self.text) self.assertTrue("Python" in noun_phrases)
After the transformation, the unit test will fail.
Closing. Ticket merged into #779.
Rename Field refactoring allows you to rename a class field with class method names It would be nice if Rope sent an alert to the user to avoid call errors
Steps to reproduce the behavior:
structure
main.py:
test.py:
After the transformation, the unit test will fail.