from typing import Set, TextIO
from io import StringIO

def observe_birds(observations_file: TextIO) -> Set[str]:
    """Return a set of the bird species listed in observations_file, which has one bird species per line.

    >>> file = StringIO("bird 1\\nbird 2\\nbird 1\\n")
    >>> birds = observe_birds(file)
    >>> 'bird 1' in birds
    True
    >>> 'bird 2' in birds
    True
    >>> len(birds) == 2
    True
    """
    birds_observed=set()
    for line in observations_file:
        bird = line.strip()
        birds_observed.add(bird)

    return birds_observed

if __name__=='__main__':
    import doctest
    doctest.testmod()
    with open('observations.txt') as observations_file:
        print(observe_birds(observations_file))
"""
>>> birds_observed = {'canada goose', 'northern fulmar', 'long-tailed jaeger', 'snow goose'}
>>> for species in birds_observed:
...     print(species)
... 
canada goose
northern fulmar
long-tailed jaeger
snow goose
"""