void (@NotNull String keyword) { final Module module = myFixture.getModule(); checkSetupArgumentText(module, keyword, null); checkRequirements(PyPackageUtil.findSetupPyRequires(module), 2); final Runnable introduceRequires = () -> PyPackageUtil.addRequirementToTxtOrSetupPy(module, "NewDjango==1.3.1", LanguageLevel.PYTHON34); WriteCommandAction.runWriteCommandAction(myFixture.getProject(), introduceRequires); checkSetupArgumentText(module, keyword, "['NewDjango==1.3.1']"); checkRequirements(PyPackageUtil.findSetupPyRequires(module), 1); final Runnable updateRequires = () -> PyPackageUtil.addRequirementToTxtOrSetupPy(module, "Markdown", LanguageLevel.PYTHON34); WriteCommandAction.runWriteCommandAction(myFixture.getProject(), updateRequires); checkSetupArgumentText(module, keyword, "['NewDjango==1.3.1', 'Markdown']"); final List<PyRequirement> actual = PyPackageUtil.findSetupPyRequires(module); final List<PyRequirement> expected = PyRequirementParser.fromText("NewDjango==1.3.1\nMarkdown\nnumpy\nmynose"); assertEquals(expected, actual); }