Level 7 : Consider the following file structure and content. If `python -m unittest discover -s tests` is executed from the `my_project` directory, will `test_standalone_function` be discovered and executed by `unittest`?


# File: my_project/tests/sub_tests/test_feature.py
import unittest

def test_standalone_function():
    """This function is not part of a unittest.TestCase class."""
    pass

class FeatureTest(unittest.TestCase):
    def test_feature_method(self):
        """This method is part of a unittest.TestCase class."""
        pass

Author: Ramya | Tags: test-discovery | 1859+ Python FAQs | Share
multiprocessing | aggregating-data-with-functools.reduce() | dataframe-and-series-objects | assignment-operators | error-handling | floating-point-precision | data-type | complex | expand-tab | datetime.date,-datetime.time,-datetime.datetime | class-and-instance-variable | filter-function | handling-missing-values-(fillna,-dropna) | enumerate() | attribute | assert | datetime | join | asyncio-module | head-and-tail | destructor | expression | creating-custom-modules | heap-memory | indexing:-loc-vs-iloc | anchors-(^,-$) | function-and-scope | data-type | bitwise-operator | floats | global-variable | append | identity-operators-(is,-is-not) | integers | higher-order-function | datatype | function-argument | lambda-functions | lambdas | format | class | generator | lambda-function | regular-expressions | math | call | quantifiers-(*,-+,-?,-{}) | list-method | inheritance | string-concatenation | built-in-function | list-mutation | syntax-error | identity-operator | arbitrary-arguments-(*args,-**kwargs) | counter | binary-operation | list-comprehension | indentation | strings | invalid-list | string-method | encapsulation | test-discovery | rollback | using-assertions-(assertequal,-assertraises) | data-type-conversions | type-conversion-and-casting | set | split | sorting-and-ranking | dictionary-methods | writing:-write(),-writelines() | regex | virtual-environment | lambda | string-formatting | asyncio | formatting-with-strftime | tuples | zip | yield | unit-testing | int | recurssion | string-method | variable | while-else-loop | sum() | id-function | working-with-dates-and-times | statement | single-inheritance | methods | data-structure | objects | mathematics | match | method | multiple-inheritance | classes | class-decorators | input-function | python-repl | numeric | feature | functional-programming | comprehension | conditional-statement | pass | thread-safe-data-structures-(queue.queue) | global | working-with-file-paths | swapping | class-and-object | benefit | precedence-and-associativity | generators-in-python | implementation | data-structure | static-method | inherit | list-indexing | binary | init | multithreading | choice | raise-statement | generators | python-history | goto-function | collection | thread-synchronization | python_version | string-iteration | staticmethod | intering | while-loops | matrix | numpy | shallow-copy | error-handling | gil | postfix | complex-number | exception-handling | __init_subclass__ | command-line-parsing | min-max-function | frozenset | version-check | bitwise | input-function | raise | managing-directories-with-os-and-shutil | global-keyword | immutable-data-type | while-loop | loop-control-statements | python-django | oops | condition | loops | __all__-attribute | working-with-temporary-files-using-tempfile | exponentiation | pep | type-conversion | immutability | thread | exception | control-flow | while-and-for-loop | functional-programming | conditional-statement | software-design | matrix-list-comprehension | mapping-function | advanced-file-operations | logical-operator | difference-between-threads-and-processes | else | docstring | default-arguments | encoding | working-with-binary-files-(rb,-wb) | conditional-statements | opening-files-(open()) | escape-operator | odd-number | data-structures-in-python | using-map()-for-transformations | object-attribute | identifier | factorial-function | map-function | deep-copy | string | memory-management | comparison | why-use-multiprocessing-over-threading?-(gil) | booleans | time-series-with-pandas | sys | python | sorting | operator-or | update | comment | functions | for | constructor | arithmetic-operation | file-handling | dictionaries | oop | operand | introduction-to-multiprocessing | using-yield-in-functions | built-in | using-lists-as-stacks | math-copysign | logical-operation | sys-module | namedtuple | list-comprehensions | filtering-and-indexing | operator | fabs-function | filter | file-handling | __future__ | method-overloading | exception-handling | directory-operations | slicing | decorator | nested-loop | tuple-unpacking | design-principle | set-operation | identity-operator | copy | sets | virtual-environment | class-and-inheritance | iterator | pandas | mysql | file_handling | overriding-methods | module | function | center | formal-and-actual-parameter | reading-and-writing-files | stack | iterators | list | library | error | data-types | interpreter | assignment-operator | package-management | lists | debugging | def | random | namespace | tuple-methods | syntax-error | indexing | literal-characters-and-special-characters | installation | multiple-inheritance | built-in-modules | operations | max-min | using-os-and-pathlib-modules | string-methods | input | control-flow | version | recursion | import-method | zfill-function | loop | list-methods-and-slicing | integer | operator-overloading | using-the-threading-module | tuple | type_conversion | sum-function | operator-and | bitwise-operator | reading-and-writing-large-files-efficiently | round-function | basic | mathematical-function | python-operators | dictionary | random-function | touples | list,-set,-and-dictionary-comprehensions | async | access-modifier | operators | threading | array | data_structure | print-statement | overflow | boolean | dicts | collections | turtle | type-conversion | list-join | else-statement | zip-function | using-join()-and-is_alive()-methods | typeerror | multiple-except-blocks | list-operation | joining-and-merging-dataframes | min-function | polymorphism | print | global-variable | keyword | introduction-to-python | using-else-and-finally | syntax | python-syntax-and-structure | introduction-to-threads | iterable | boolean-masking | syntaxerror | context-manager | compute | python-module | string-formatting | reading:-read(),-readline(),-readlines() | pseudocode | sorted | range | logical-operators | parsing-with-strptime | scientific-notation | arithmetic-expression | built-in-function | round | application | dictionary-comprehensions | descriptors | control-statement | key-value-pairs | defining-functions | precedence | string-manipulation | parameter | loop-control | mutable | matplotlib | list-slicing | with-statement | counter-function | memory | file | magic-method | name-mangling | string-slicing | list-vs-tuple | walking-through-directories-using-os.walk() | slice | return-statement | decimal | default-mutable-argument | membership-operators-(in,-not-in) | creating-and-starting-threads | conversion | boolean-and-non-boolean | regular-expression | logical-operator | data-structures | list-comprehension | pickling--unpickling | string-slicing ...