Module ImportFrom alias alias alias alias alias alias alias Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return Call AttributeLoad AttributeLoad Call NameLoad NameLoad NameLoad attr attr Call NameLoad keyword Dict Str Str NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Call NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr NameLoad NameStore body Expr Call AttributeLoad NameLoad attr Call NameLoad Str Expr Call AttributeLoad NameLoad attr ListComp AttributeLoad NameLoad attr comprehension NameStore AttributeLoad AttributeLoad NameLoad attr attr ListLoad Str decorator_list FunctionDef arguments args NameParam defaults body With Call AttributeLoad NameLoad attr NameLoad NameStore body Expr Call AttributeLoad NameLoad attr Call NameLoad Str Expr Call AttributeLoad NameLoad attr ListComp AttributeLoad NameLoad attr comprehension NameStore AttributeLoad AttributeLoad NameLoad attr attr ListLoad Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str With Call NameLoad Str NameStore body Expr Call AttributeLoad NameLoad attr keyword Num Expr Call AttributeLoad NameLoad attr keyword NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad Str Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad TupleLoad Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str With Call NameLoad Str NameStore body Assign AttributeStore AttributeLoad Call NameLoad attr attr Call NameLoad Num Expr Call AttributeLoad NameLoad attr keyword Num Expr Call AttributeLoad NameLoad attr keyword NameLoad With Call AttributeLoad NameLoad attr NameLoad NameStore body Expr Call AttributeLoad NameLoad attr Call NameLoad Str Expr Call AttributeLoad NameLoad attr ListComp AttributeLoad NameLoad attr comprehension NameStore AttributeLoad AttributeLoad NameLoad attr attr ListLoad Str Assign TupleStore NameStore NameStore AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad TupleLoad Num decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad kwarg body Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str With Call NameLoad NameLoad NameStore body Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad Assign NameStore Call AttributeLoad Call NameLoad keyword NameLoad attr Expr Call AttributeLoad NameLoad attr keyword ListLoad Str NameLoad Str Str Str Str keyword Call NameLoad keyword NameLoad With Call NameLoad NameLoad NameStore body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr ListLoad NameLoad Str NameLoad Str NameLoad NameLoad If CompareIn Str NameLoad body Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str Str ListLoad Str Assign NameStore ListLoad If NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad Expr Call AttributeLoad NameLoad attr keyword NameLoad keyword ListLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str Call NameLoad Str Expr Call AttributeLoad NameLoad attr keyword Str Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr keyword ListLoad Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Str Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr keyword ListLoad Call AttributeLoad NameLoad attr Str With Call AttributeLoad NameLoad attr NameLoad Str body Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Str Call NameLoad Str Expr Call AttributeLoad NameLoad attr keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword ListLoad Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr keyword NameLoad Expr Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr ListLoad Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr ListLoad Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Str Expr Call NameLoad NameLoad Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr ListLoad NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr ListLoad Call AttributeLoad Str attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr keyword Str keyword NameLoad keyword ListLoad Str keyword ListLoad Str Expr Call AttributeLoad NameLoad attr Call NameLoad Str keyword Str decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr keyword Str keyword NameLoad keyword ListLoad Str keyword ListLoad Str Str Expr Call AttributeLoad NameLoad attr Call NameLoad Str keyword Str decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr keyword Str keyword NameLoad keyword ListLoad Str keyword Dict Str Str Num Num Expr Call AttributeLoad NameLoad attr keyword Str keyword NameLoad keyword ListLoad Str keyword Dict Str Str Num Num Expr Call AttributeLoad NameLoad attr Call NameLoad Str keyword Str Expr Call AttributeLoad NameLoad attr Call NameLoad Str keyword Str keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body With Call NameLoad keyword Str keyword Str body Expr Call AttributeLoad NameLoad attr keyword Str keyword NameLoad keyword ListLoad Str keyword Dict Str Str Str NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad Str keyword Str decorator_list decorator_list
N/A __future__ absolute_import division generators nested_scopes print_function unicode_literals with_statement N/A os N/A subprocess textwrap dedent mock patch pants.backend.jvm.targets.java_tests JavaTests pants.backend.jvm.tasks.junit_run JUnitRun pants.backend.python.targets.python_tests PythonTests pants.base.exceptions TargetDefinitionException TaskError pants.build_graph.build_file_aliases BuildFileAliases pants.build_graph.resources Resources pants.ivy.bootstrapper Bootstrapper pants.ivy.ivy_subsystem IvySubsystem pants.java.distribution.distribution DistributionLocator pants.java.executor SubprocessExecutor pants.util.contextutil environment_as pants.util.dirutil safe_file_dump pants.util.timeout TimeoutReached pants_test.jvm.jvm_tool_task_test_base JvmToolTaskTestBase pants_test.subsystem.subsystem_util subsystem_instance JUnitRunnerTest N/A JvmToolTaskTestBase N/A N/A Tests for junit_run._JUnitRunner class task_type N/A N/A cls N/A N/A N/A JUnitRun N/A classmethod alias_groups N/A N/A self N/A N/A N/A N/A N/A N/A N/A super JUnitRunnerTest self alias_groups merge N/A BuildFileAliases targets N/A java_tests python_tests JavaTests PythonTests N/A property test_junit_runner_success N/A N/A self N/A N/A N/A N/A N/A self execute_junit_runner N/A dedent 
        import org.junit.Test;
        import static org.junit.Assert.assertTrue;
        public class FooTest {
          @Test
          public void testFoo() {
            assertTrue(5 > 3);
          }
        }
       N/A test_junit_runner_failure N/A N/A self N/A N/A N/A N/A N/A self assertRaises TaskError cm N/A N/A N/A N/A self execute_junit_runner N/A dedent 
          import org.junit.Test;
          import static org.junit.Assert.assertTrue;
          public class FooTest {
            @Test
            public void testFoo() {
              assertTrue(5 < 3);
            }
          }
         N/A N/A N/A self assertEqual N/A N/A t name N/A t N/A N/A cm exception failed_targets N/A foo_test N/A test_junit_runner_error N/A N/A self N/A N/A N/A N/A N/A self assertRaises TaskError cm N/A N/A N/A N/A self execute_junit_runner N/A dedent 
          import org.junit.Test;
          public class FooTest {
            @Test
            public void testFoo() {
              throw new RuntimeException("test error");
            }
          }
         N/A N/A N/A self assertEqual N/A N/A t name N/A t N/A N/A cm exception failed_targets N/A foo_test N/A test_junit_runner_timeout_success N/A N/A self N/A N/A N/A When we set a timeout and don't force failure, succeed. N/A N/A patch pants.task.testrunner_task_mixin.Timeout mock_timeout N/A N/A N/A N/A self set_options timeout_default 1 N/A N/A N/A self set_options timeouts True N/A N/A N/A self execute_junit_runner N/A dedent 
          import org.junit.Test;
          import static org.junit.Assert.assertTrue;
          public class FooTest {
            @Test
            public void testFoo() {
              assertTrue(5 > 3);
            }
          }
         N/A N/A args kwargs N/A mock_timeout call_args N/A N/A N/A self assertEqual args N/A 1 N/A test_junit_runner_timeout_fail N/A N/A self N/A N/A N/A When we set a timeout and force a failure, fail. N/A N/A patch pants.task.testrunner_task_mixin.Timeout mock_timeout N/A N/A N/A N/A N/A mock_timeout __exit__ side_effect N/A TimeoutReached 1 N/A N/A N/A self set_options timeout_default 1 N/A N/A N/A self set_options timeouts True N/A N/A N/A self assertRaises TaskError cm N/A N/A N/A N/A self execute_junit_runner N/A dedent 
            import org.junit.Test;
            import static org.junit.Assert.assertTrue;
            public class FooTest {
              @Test
              public void testFoo() {
                assertTrue(5 > 3);
              }
            }
           N/A N/A N/A self assertEqual N/A N/A t name N/A t N/A N/A cm exception failed_targets N/A foo_test N/A N/A args kwargs N/A mock_timeout call_args N/A N/A N/A self assertEqual args N/A 1 N/A execute_junit_runner N/A N/A self content create_some_resources N/A True kwargs N/A N/A test_rel_path tests/java/org/pantsbuild/foo N/A test_abs_path N/A N/A self create_dir test_rel_path N/A test_java_file_rel_path N/A N/A N/A os path join test_rel_path FooTest.java N/A test_java_file_abs_path N/A N/A self create_file test_java_file_rel_path content N/A test_classes_abs_path N/A N/A self create_workdir_dir test_rel_path N/A classpath_file_abs_path N/A N/A N/A os path join test_abs_path junit.classpath N/A N/A subsystem_instance IvySubsystem ivy_subsystem N/A N/A distribution N/A N/A DistributionLocator cached jdk True N/A ivy N/A N/A N/A Bootstrapper ivy_subsystem ivy_subsystem ivy N/A N/A N/A ivy execute args N/A -cachepath classpath_file_abs_path -dependency junit junit-dep 4.10 executor N/A SubprocessExecutor distribution distribution N/A N/A open classpath_file_abs_path fp N/A N/A classpath N/A N/A fp read N/A javac N/A N/A distribution binary javac N/A N/A N/A subprocess check_call N/A javac -d test_classes_abs_path -cp classpath test_java_file_abs_path N/A N/A target_name kwargs N/A N/A target N/A N/A self target N/A kwargs N/A target_name N/A N/A target N/A N/A self create_library test_rel_path java_tests foo_test N/A FooTest.java N/A target_roots N/A N/A create_some_resources N/A N/A N/A N/A target_roots append N/A N/A self make_target some_resources Resources N/A N/A N/A target_roots append target N/A context N/A N/A self context target_roots target_roots N/A N/A N/A self populate_runtime_classpath context context classpath N/A test_classes_abs_path N/A N/A N/A self execute context N/A test_junit_runner_raises_no_error_on_non_junit_target N/A N/A self N/A N/A N/A Run pants against a `python_tests` target, but set an option for the `test.junit` task. This
    should execute without error.
     N/A N/A N/A self add_to_build_file foo N/A dedent 
        python_tests(
          name='hello',
          sources=['some_file.py'],
        )
         N/A N/A N/A self set_options test #abc N/A task N/A N/A self create_task N/A N/A self context target_roots N/A N/A N/A self target foo:hello N/A N/A N/A task execute N/A test_empty_sources N/A N/A self N/A N/A N/A N/A N/A self add_to_build_file foo N/A dedent 
        java_tests(
          name='empty',
          sources=[],
        )
         N/A task N/A N/A self create_task N/A N/A self context target_roots N/A N/A N/A self target foo:empty N/A N/A N/A self assertRaisesRegexp TargetDefinitionException must include a non-empty set of sources N/A N/A N/A N/A task execute N/A test_allow_empty_sources N/A N/A self N/A N/A N/A N/A N/A self add_to_build_file foo N/A dedent 
        java_tests(
          name='empty',
          sources=[],
        )
         N/A N/A N/A self set_options allow_empty_sources True N/A context N/A N/A self context target_roots N/A N/A N/A self target foo:empty N/A N/A N/A self populate_runtime_classpath context context N/A N/A N/A N/A N/A self create_task context execute N/A test_request_classes_by_source N/A N/A self N/A N/A N/A `classes_by_source` is expensive to compute: confirm that it is only computed when needed. N/A N/A N/A self assertFalse N/A N/A JUnitRun request_classes_by_source N/A com.goo.ber N/A N/A N/A self assertFalse N/A N/A JUnitRun request_classes_by_source N/A com.goo.ber#method N/A srcfile N/A N/A N/A os path join N/A self test_workdir this.is.a.source.file.scala N/A N/A safe_file_dump srcfile content! N/A N/A N/A self assertTrue N/A N/A JUnitRun request_classes_by_source N/A srcfile N/A N/A N/A self assertTrue N/A N/A JUnitRun request_classes_by_source N/A N/A N/A {}#method format srcfile N/A test_junit_runner_extra_jvm_options N/A N/A self N/A N/A N/A N/A N/A self make_target spec foo:foo_test target_type JavaTests sources N/A FooTest.java extra_jvm_options N/A -Dexample.property=1 N/A N/A N/A self execute_junit_runner N/A dedent 
        import org.junit.Test;
        import static org.junit.Assert.assertTrue;
        public class FooTest {
          @Test
          public void testFoo() {
            String exampleProperty = System.getProperty("example.property");
            assertTrue(exampleProperty != null && exampleProperty.equals("1"));
          }
        }
       target_name foo:foo_test N/A test_junit_runner_multiple_extra_jvm_options N/A N/A self N/A N/A N/A N/A N/A self make_target spec foo:foo_test target_type JavaTests sources N/A FooTest.java extra_jvm_options N/A -Dexample.property1=1 -Dexample.property2=2 N/A N/A N/A self execute_junit_runner N/A dedent 
        import org.junit.Test;
        import static org.junit.Assert.assertTrue;
        public class FooTest {
          @Test
          public void testFoo() {
            String exampleProperty1 = System.getProperty("example.property1");
            assertTrue(exampleProperty1 != null && exampleProperty1.equals("1"));
            String exampleProperty2 = System.getProperty("example.property2");
            assertTrue(exampleProperty2 != null && exampleProperty2.equals("2"));
            String exampleProperty3 = System.getProperty("example.property3");
            assertTrue(exampleProperty3 == null);
          }
        }
       target_name foo:foo_test N/A test_junit_runner_extra_env_vars N/A N/A self N/A N/A N/A N/A N/A self make_target spec foo:foo_test target_type JavaTests sources N/A FooTest.java extra_env_vars N/A HELLO THERE 27 32 N/A N/A N/A self make_target spec bar:bar_test target_type JavaTests sources N/A FooTest.java extra_env_vars N/A THE_ANSWER HELLO 42 12 N/A N/A N/A self execute_junit_runner N/A dedent 
        import org.junit.Test;
        import static org.junit.Assert.assertEquals;
        public class FooTest {
          @Test
          public void testFoo() {
            assertEquals("27", System.getenv().get("HELLO"));
            assertEquals("32", System.getenv().get("THERE"));
          }
        }
       target_name foo:foo_test N/A N/A N/A self execute_junit_runner N/A dedent 
        import org.junit.Test;
        import static org.junit.Assert.assertEquals;
        import static org.junit.Assert.assertFalse;
        public class FooTest {
          @Test
          public void testFoo() {
            assertEquals("12", System.getenv().get("HELLO"));
            assertEquals("42", System.getenv().get("THE_ANSWER"));
            assertFalse(System.getenv().containsKey("THERE"));
          }
        }
       target_name bar:bar_test create_some_resources False N/A test_junit_runner_extra_env_vars_none N/A N/A self N/A N/A N/A N/A environment_as THIS_VARIABLE 12 THAT_VARIABLE This is a variable. N/A N/A N/A N/A self make_target spec foo:foo_test target_type JavaTests sources N/A FooTest.java extra_env_vars N/A HELLO THERE THIS_VARIABLE None False None N/A N/A N/A self execute_junit_runner N/A dedent 
          import org.junit.Test;
          import static org.junit.Assert.assertEquals;
          import static org.junit.Assert.assertFalse;
          public class FooTest {
            @Test
            public void testFoo() {
              assertEquals("False", System.getenv().get("THERE"));
              assertEquals("This is a variable.", System.getenv().get("THAT_VARIABLE"));
              assertFalse(System.getenv().containsKey("HELLO"));
              assertFalse(System.getenv().containsKey("THIS_VARIABLE"));
            }
          }
         target_name foo:foo_test N/A N/A