1 package com.jetbrains.env;
3 import com.google.common.collect.Sets;
4 import com.jetbrains.python.psi.LanguageLevel;
5 import org.jetbrains.annotations.NotNull;
6 import org.jetbrains.annotations.Nullable;
13 public abstract class PyTestTask {
14 private String myScriptName;
15 private String myScriptParameters;
19 public void setScriptName(String scriptName) {
20 myScriptName = scriptName;
23 public void setScriptParameters(String scriptParameters) {
24 myScriptParameters = scriptParameters;
27 public void setUp(String testName) throws Exception {
30 public void tearDown() throws Exception {
34 * Run test on certain SDK path.
35 * To create SDK from path, use {@link PyExecutionFixtureTestTask#createTempSdk(String, com.jetbrains.python.sdkTools.SdkCreationType)}
37 * @param sdkHome sdk path
39 public abstract void runTestOn(String sdkHome) throws Exception;
41 public void before() throws Exception {
44 public void testing() throws Exception {
47 public void after() throws Exception {
50 public void doFinally() {
53 public void useNormalTimeout() {
56 public void useLongTimeout() {
59 public String getScriptName() {
65 public String getScriptParameters() {
66 return myScriptParameters;
71 * @return tags this task needs to exist on interpreter to run
74 public Set<String> getTags() {
75 return Sets.newHashSet();
79 * Checks if task supports this language level
80 * @param level level to check
81 * @return true if supports
83 public boolean isLanguageLevelSupported(@NotNull final LanguageLevel level) {
88 * Provides a way to filter out non-relevant environments
90 * @return the set of a tags that interpreter should run on, if an environment doesn't contain one of them, it won't be
91 * used to run this test task.
92 * null in case filtering shouldn't be used
95 public Set<String> getTagsToCover() {